#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
    int x = 0;
    scanf("%d", &x);
    getchar();
    char w;
    scanf("%c", &w);
    int j = 1;
    while (2 * j * j - 1 <= x)
    {
        j++;
    }
    j--;
    int a = 2 * j - 1;
    char arr[100][100] = { ' ' };
    for (int i = 0; i < a; i++)
    {
        for (int j = 0; j < a; j++)
        {
            arr[i][j] = ' ';
        }
    }
    int m = 0;
    int n = a;
    int c = 0;
    do
    {
        for (int i = m; i < n; i++)
        {
            arr[m][i] = w;
            arr[n - 1][i] = w;
        }
        m++;
        n--;
    } while (m < n);
    int y = a;
    int z = 0;
    for (z = 0; z < a; z++)
    {
        for (int d = 0; d < y; d++)
        {
            printf("%c", arr[z][d]);
        }
        if (y == j)
        {
            break;
        }
        else
        {
            y--;
            printf("\n");
        }
    }
    printf("\n");
    z++;
    y++;
    for (z; z < a; z++)
    {
        for (int d = 0; d < y; d++)
        {
            printf("%c", arr[z][d]);
        }
        y++;
        printf("\n");
    }
    int num = 0;
    num = x - 2 * j * j + 1;
    printf("%d", num);
    return 0;
}